package com.silence.gankio.net

import com.silence.gankio.bean.GankIoBean
import com.silence.gankio.mvp.control.HttpControl

abstract class GankIoObserver<T>(mView: HttpControl.IHttpView) : BaseObserver<GankIoBean<T>>(mView) {

    override fun onNext(t: GankIoBean<T>) {
        t.results?.let {
            onSuccess(it[0])
        }
    }

    /**
     * 根据具体的Api 业务逻辑去重写 onSuccess 方法！Error 是选择重写，but 必须Super ！
     *
     * @param t
     */
    abstract fun onSuccess(t: T)

}